package com.ruoyi.campus.dto;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 小程序账号密码登录请求
 * 
 * @author campus-alarm
 * @date 2024-01-01
 */
public class MiniProgramLoginRequest {

    /**
     * 登录账号（用户名或手机号）
     */
    @NotBlank(message = "登录账号不能为空")
    private String account;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    private String password;

    /**
     * 登录类型：username-用户名登录，phone-手机号登录
     */
    @NotBlank(message = "登录类型不能为空")
    @Pattern(regexp = "^(username|phone)$", message = "登录类型只能是username或phone")
    private String loginType;

    /**
     * 验证码（手机号登录时可选）
     */
    private String captcha;

    /**
     * 验证码key（与验证码对应）
     */
    private String captchaKey;

    /**
     * 记住我（可选）
     */
    private Boolean rememberMe = false;

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getLoginType() {
        return loginType;
    }

    public void setLoginType(String loginType) {
        this.loginType = loginType;
    }

    public String getCaptcha() {
        return captcha;
    }

    public void setCaptcha(String captcha) {
        this.captcha = captcha;
    }

    public String getCaptchaKey() {
        return captchaKey;
    }

    public void setCaptchaKey(String captchaKey) {
        this.captchaKey = captchaKey;
    }

    public Boolean getRememberMe() {
        return rememberMe;
    }

    public void setRememberMe(Boolean rememberMe) {
        this.rememberMe = rememberMe;
    }

    @Override
    public String toString() {
        return "MiniProgramLoginRequest{" +
                "account='" + account + '\'' +
                ", loginType='" + loginType + '\'' +
                ", rememberMe=" + rememberMe +
                '}';
    }
} 